const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: './',
  chainWebpack: config => {
    config.resolve.alias.set('@', resolve('src'))
  },
  devServer: {
    port: 8002,
    proxy: {
      '/api': {
        target: 'http://120.78.213.231:82/api',
        // target: 'http://192.168.1.209:8090/api',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  }
}
